/**
 * Created by JOKER on 2017/8/21.
 */
'use strict';
(function (window, angular, undefined) {
    app.service("commonService", commonService);
    commonService.$inject = ['$http', '$q'];// 注入依赖
    function commonService($http, $q) {
        var services = {
            postSend: postSend
        }
        return services;

        function postSend(url, formObj) {
            var deferred = $q.defer();
            $http({
                method: 'post',
                url: url,
                data: formObj
            }).then(function successCallback(response) {
                return deferred.resolve(response.data);
            }, function errorCallback(response) {
                return deferred.reject(response.data);
            });
            return deferred.promise;
        }
    }
})(window, window.angular);